﻿<%@ Control Language="VB" AutoEventWireup="false" CodeFile="MyDetailsControl.ascx.vb"
    Inherits="Controls_MyDetailsControl1" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
<style type="text/css">
    table.myTable {
        border-collapse: collapse;
    }

    table.myTable td, table.myTable th {
        border: 1px solid black;
        padding: 5px;
        }

    .hiddden {
        visibility: hidden;
    }
</style>

<asp:ObjectDataSource ID="ObjectDataSource1" runat="server" DeleteMethod="Delete"
    InsertMethod="Insert" OldValuesParameterFormatString="original_{0}" SelectMethod="GetData"
    TypeName="LogginsLogDSTableAdapters.PersonTableAdapter" UpdateMethod="Update">
    <DeleteParameters>
        <asp:Parameter Name="Original_Id" Type="Int32" />
    </DeleteParameters>
    <InsertParameters>
        <asp:Parameter DbType="Guid" Name="UserId" />
        <asp:Parameter Name="FirstName" Type="String" />
        <asp:Parameter Name="LastName" Type="String" />
        <asp:Parameter Name="MiddleInitial" Type="String" />
        <asp:Parameter Name="DisplayName" Type="String" />
        <asp:Parameter Name="ContactEmail" Type="String" />
        <asp:Parameter Name="ReportEmail" Type="String" />
        <asp:Parameter Name="ContactPhone" Type="String" />
        <asp:Parameter Name="ContactMobile" Type="String" />
        <asp:Parameter Name="Active" Type="Boolean" />
        <asp:Parameter Name="ReadTerms" Type="Boolean" />
        <asp:Parameter Name="AddToMailList" Type="Boolean" />
        <asp:Parameter Direction="InputOutput" Name="PersonId" Type="Object" />
    </InsertParameters>
    <SelectParameters>
        <asp:Parameter DbType="Guid" Name="UserId" />
    </SelectParameters>
    <UpdateParameters>
        <asp:Parameter DbType="Guid" Name="UserId" />
        <asp:Parameter Name="FirstName" Type="String" />
        <asp:Parameter Name="LastName" Type="String" />
        <asp:Parameter Name="MiddleInitial" Type="String" />
        <asp:Parameter Name="DisplayName" Type="String" />
        <asp:Parameter Name="ContactEmail" Type="String" />
        <asp:Parameter Name="ReportEmail" Type="String" />
        <asp:Parameter Name="ContactPhone" Type="String" />
        <asp:Parameter Name="ContactMobile" Type="String" />
        <asp:Parameter Name="Active" Type="Boolean" />
        <asp:Parameter Name="ReadTerms" Type="Boolean" />
        <asp:Parameter Name="AddToMailList" Type="Boolean" />
        <asp:Parameter Name="Original_Id" Type="Int32" />
    </UpdateParameters>
</asp:ObjectDataSource>
<asp:FormView ID="FormView2" runat="server" DataKeyNames="Id" DataSourceID="ObjectDataSource1"
    DefaultMode="Edit">
    <EditItemTemplate>



        <table class="myTable" >
            <tr>
                <td  valign="top">First Name: *
                </td>
                <td>
                    <asp:TextBox ID="txtFirstName" runat="server" Text='<%# Bind("FirstName") %>' />
                    &nbsp;<asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="txtFirstName" Display="Dynamic" ErrorMessage="A First Name is Required"></asp:RequiredFieldValidator>
                </td>
            </tr>
            <tr>
                <td>Last Name: *
                </td>
                <td>
                    <asp:TextBox ID="txtLastName" runat="server" Text='<%# Bind("LastName") %>' />
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ControlToValidate="txtLastName" ErrorMessage="A Last Name is Required" Display="Dynamic"></asp:RequiredFieldValidator>
                </td>
            </tr>
            <tr>
                <td>Initials:
                </td>
                <td>
                    <asp:TextBox ID="txtMiddleInitial" runat="server" Text='<%# Bind("MiddleInitial") %>' />
                </td>
            </tr>
            <tr>
                <td>Display Name:
                </td>
                <td>
                    <asp:TextBox ID="txtDisplayName" runat="server" Text='<%# Bind("DisplayName") %>' />
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" ControlToValidate="txtDisplayName" ErrorMessage="A Display Name is Required" Display="Dynamic"></asp:RequiredFieldValidator>
                </td>
            </tr>
            <tr>
                <td>Contact Email: *
                </td>
                <td>
                    <asp:TextBox ID="txtContactEmail" runat="server" Text='<%# Bind("ContactEmail") %>'
                        Width="172px" />
                    <asp:RegularExpressionValidator ID="RegularExpressionValidator5" runat="server" ControlToValidate="txtContactEmail" ErrorMessage="A Contact Email Address is Required" ValidationExpression="\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*" Display="Dynamic"></asp:RegularExpressionValidator>
                </td>
            </tr>
            <tr>
                <td>Report Email: *
                </td>
                <td>
                    <asp:TextBox ID="txtReportEmail" runat="server" Text='<%# Bind("ReportEmail") %>'
                        Width="172px" />
                    <asp:RegularExpressionValidator ID="RegularExpressionValidator6" runat="server" ControlToValidate="txtReportEmail" ErrorMessage="A Report Email Address is Required" ValidationExpression="\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*" Display="Dynamic"></asp:RegularExpressionValidator>
                </td>
            </tr>
            <tr>
                <td>Contact Phone: *
                </td>
                <td>
                    <asp:TextBox ID="txtContactPhone" runat="server" Text='<%# Bind("ContactPhone") %>'
                        ControlToValidate="txtContactPhone" />
                    <asp:MaskedEditExtender ID="txtContactPhone_MaskedEditExtender" runat="server" Mask="+999999999999"
                        OnFocusCssClass="MaskedEditFocus" OnInvalidCssClass="MaskedEditError" AcceptNegative="None"
                        CultureAMPMPlaceholder="" CultureCurrencySymbolPlaceholder="" CultureDateFormat=""
                        CultureDatePlaceholder="" CultureDecimalPlaceholder="" CultureThousandsPlaceholder=""
                        CultureTimePlaceholder="" DisplayMoney="None" Enabled="True" InputDirection="LeftToRight"
                        TargetControlID="txtContactPhone" UserDateFormat="None" UserTimeFormat="None">
                    </asp:MaskedEditExtender>
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator5" runat="server" ControlToValidate="txtContactPhone" ErrorMessage="A Contact Phone is Required" Display="Dynamic"></asp:RequiredFieldValidator>
                </td>
            </tr>
            <tr>
                <td>Contact Mobile: *
                </td>
                <td>
                    <asp:TextBox ID="txtContactMobile" runat="server" Text='<%# Bind("ContactMobile") %>'
                        Width="170px" />
                    <asp:MaskedEditExtender ID="MaskedEditExtender1" runat="server" Mask="+999999999999"
                        OnFocusCssClass="MaskedEditFocus" OnInvalidCssClass="MaskedEditError" AcceptNegative="None"
                        CultureAMPMPlaceholder="" CultureCurrencySymbolPlaceholder="" CultureDateFormat=""
                        CultureDatePlaceholder="" CultureDecimalPlaceholder="" CultureThousandsPlaceholder=""
                        CultureTimePlaceholder="" DisplayMoney="None" Enabled="True" InputDirection="LeftToRight"
                        TargetControlID="txtContactMobile" UserDateFormat="None" UserTimeFormat="None">
                    </asp:MaskedEditExtender>
                </td>
            </tr>
            <%-- <tr>
                <td>
                    &nbsp;
                </td>
                <td>
                </td>
                <td>
                    &nbsp;
                </td>
            </tr>--%>
            <tr>
                <td>Add To MailList:
                </td>
                <td>
                    <asp:CheckBox ID="AddToMailListCheckBox" runat="server" Checked='<%# Bind("AddToMailList") %>' />
                </td>
            </tr>
            <tr>
                <td>
                </td>
                <td>&nbsp;<asp:Button ID="Button1" runat="server" CausesValidation="True" CommandName="Update"
                    Text="Submit" />
                    <asp:Button ID="Button2" runat="server" CausesValidation="False" CommandName="Home"
                        Text="Cancel" />
                </td>
            </tr>
        </table>
             

        <asp:CheckBox ID="ReadTermsCheckBox" runat="server" Checked='<%# Bind("ReadTerms") %>'
            CssClass="hiddden" />
        <asp:CheckBox ID="ActiveCheckBox" runat="server" Checked='<%# Bind("Active") %>'
            CssClass="hiddden" />
        <asp:TextBox ID="txtUserId" runat="server" Text='<%# Bind("UserId") %>' CssClass="hiddden" />
        <asp:Label ID="lblId" runat="server" Text='<%# Eval("Id") %>' CssClass="hiddden" />
        <br />
        <%--<asp:LinkButton ID="UpdateButton" runat="server" CausesValidation="True" 
                CommandName="Update" Text="Update" />
            &nbsp;<asp:LinkButton ID="UpdateCancelButton" runat="server" 
                CausesValidation="False" CommandName="Cancel" Text="Cancel" />
        --%>
    </EditItemTemplate>
</asp:FormView>


